﻿@model Nop.Admin.Models.Advert.AdvertisementModel
@using Telerik.Web.Mvc.UI;
@Html.ValidationSummary(false)
@Html.HiddenFor(model => model.Id)
@Html.Telerik().TabStrip().Name("a-edit").Items(x =>
{
    x.Add().Text(T("Admin.Advert.Advertisement.Info").Text).Content(TabInfo().ToHtmlString()).Selected(true);

    //generate an event
    EngineContext.Current.Resolve<IEventPublisher>().Publish(new AdminTabStripCreated(x, "advertisement-edit"));
})
@helper TabInfo()
    { 
    @(Html.LocalizedEditor<Nop.Admin.Models.Advert.AdvertisementModel, Nop.Admin.Models.Advert.AdvertisementLocalizedModel>("advertisement-info-localized",
@<table class="adminContent">
<tr>
<td class="adminTitle">
@Html.NopLabelFor(model => model.Locales[item].Name):
</td>
<td class="adminData">
@Html.EditorFor(model => Model.Locales[item].Name)
@Html.ValidationMessageFor(model => model.Locales[item].Name)
</td>
</tr>
<tr>
<td class="adminTitle">
@Html.NopLabelFor(model => model.Name):
</td>
<td class="adminData">
@Html.EditorFor(model => model.Name)
@Html.ValidationMessageFor(model => model.Name)
</td>
</tr>
<tr>
<td class="adminTitle">
@Html.NopLabelFor(model => model.Locales[item].Description):
</td>
<td class="adminData">
@Html.TextAreaFor(model => model.Description, new { width="500px;" })
@Html.ValidationMessageFor(model => model.Locales[item].Description)
</td>
</tr>
<tr>
<td colspan="2">
@Html.HiddenFor(model => model.Locales[item].LanguageId)
</td>
</tr>
</table>
,
@<table class="adminContent">
<tr>
<td class="adminTitle">
@Html.NopLabelFor(model => model.Name):
</td>
<td class="adminData">
@Html.TextAreaFor(x => x.Name, new { width = "500px;" })
@Html.ValidationMessageFor(model => model.Name)
</td>
</tr>
<tr>
<td class="adminTitle">
@Html.NopLabelFor(model => model.Description):
</td>
<td class="adminData">
@Html.TextAreaFor(x => x.Description, new { width = "500px;" })
@Html.ValidationMessageFor(model => model.Description)
</td>
</tr>
</table>
))
<table class="adminContent">
<tr>
<td class="adminTitle">
@Html.NopLabelFor(model => model.Url):
</td>
<td class="adminData">
@Html.EditorFor(x => x.Url)
@Html.ValidationMessageFor(model => model.Url)
</td>
</tr>
<tr>
<td class="adminTitle">
@Html.NopLabelFor(model => model.AdvertContent):
</td>
<td class="adminData">
@Html.EditorFor(x => x.AdvertContent, "RichEditor")
</td>
</tr>
<tr>
<td class="adminTitle">
@Html.NopLabelFor(model => model.StartTime):
</td>
<td class="adminData">
@Html.EditorFor(model => model.StartTime) -  @Html.EditorFor(model => model.EndTime)
</td>
</tr>
<tr>
<td class="adminTitle">
@Html.NopLabelFor(model => model.AdverType):
</td>
<td class="adminData">
@Html.DropDownListFor(model => model.AdverType, Model.AvailableAdvertTypeTemplates)
</td>
</tr>
<tr>
<td class="adminTitle">
@Html.NopLabelFor(model => model.AdverPosition):
</td>
<td class="adminData">
@Html.DropDownListFor(model => model.AdverPosition, Model.AvailableAdverPositionTemplates)
</td>
</tr>
<tr>
<td class="adminTitle">
@Html.NopLabelFor(model => model.AdverLevel):
</td>
<td class="adminData">
@Html.DropDownListFor(model => model.AdverLevel, Model.AvailableAdverLevelTemplates)
</td>
</tr>
<tr>
<td class="adminTitle">
@Html.NopLabelFor(model => model.Deleted):
</td>
<td class="adminData">
@Html.EditorFor(x => x.Deleted)
@Html.ValidationMessageFor(model => model.Deleted)
</td>
</tr>
<tr>
<td class="adminTitle">
@Html.NopLabelFor(model => model.DisplayOrder):
</td>
<td class="adminData">
@Html.EditorFor(model => model.DisplayOrder)
@Html.ValidationMessageFor(model => model.DisplayOrder)
</td>
</tr>
</table>
}

